
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>百度文字转语音接口demo - 卡卡网 www.webkaka.com</title>
<body>
<b>该实例是把如下文字转为语音(JavaScript实现)：</b><br>
<font color=red>测试百度文字转语音接口 - 卡卡测速网 www.webkaka.com</font>

<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2::51" alt="点击这里给我发消息" title="点击这里给我发消息"/></a>


<script type="text/javascript"> 
var zhText = "测试百度文字转语音接口 - 卡卡测速网 www.webkaka.com"; 
zhText = encodeURI(zhText);
document.write("<audio  controls autoplay=\"autoplay\">");
document.write("<source src=\"http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=5&per=0&text="+ zhText +"\" type=\"audio/mpeg\">");
//document.write("<embed height=\"0\" width=\"0\" src=\"http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=2&text="+ zhText +"\">");
document.write("</audio>");
</script>
</body>
</html>